package com.ws.mapper;

import com.ws.bean.Suppliers;
import com.ws.bean.vo.SupplierVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface SupplierMapper {

    List<Suppliers> list(SupplierVo supplierVo);

    @Insert("insert into suppliers(supplier_name,supplier_address,contactInfo) values(#{supplier_name},#{supplier_address},#{contactInfo})")
    int add(Suppliers suppliers);

    @Delete("delete from suppliers where supplier_id=#{id}")
    int delete(Integer id);

    @Select("select * from suppliers where supplier_id=#{id}")
    Suppliers getSupplierById(Integer id);

    @Update("update suppliers set supplier_name=#{supplier_name},supplier_address=#{supplier_address},contactInfo=#{contactInfo} where supplier_id=#{supplier_id}")
    int update(Suppliers suppliers);
}
